home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-09-12 | 1.0 KB | 43 lines | [TEXT/CCL2] |
- (require 'appleevent-toolkit)
- (use-package "DEFAPPLEEVENTS")
-
- ;; Define an applevent format for sending data
- ;;
- (defappleevent send :|MACL| :|send|
- ((direct-object #$keyDirectObject))
- ())
-
- (defvar *sdo* nil)
-
- ;; Handle the SEND event by printing the data and storing it in the
- ;; global *sdo*
-
- (defun print-sent-thing (application appleevent reply refcon)
- (declare (ignore application reply refcon))
- (setf *sdo* (send-direct-object appleevent))
- (print *sdo* *standard-output*))
-
- (install-appleevent-handler :|MACL| :|send| #'print-sent-thing)
-
- ;; Allocate some records
- ;;
- (defvar aerecord (make-record :appleevent))
- (defvar target (make-record :aedesc))
-
-
- (create-self-target target)
- ;(choose-appleevent-target target)
-
- (defun send-thing (thing)
- (send-appleevent (make-send aerecord target
- :direct-object thing)
- (%null-ptr)))
-
- #|
- (send-thing 666)
- (send-thing "a string")
- (send-thing `(:aelist integer 3 string "STRING" float ,pi))
-
- (#_aedisposedesc aerecord)
- (#_aedisposedesc target)
- |#